<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>

    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/reset.css"
          media="screen"/>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/grid.css"
          media="screen"/>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css"
          media="screen"/>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/messages.css"
          media="screen"/>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/forms.css"
          media="screen"/>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tables.css"
          media="screen"/>

    <!--[if lt IE 8]>
    <link rel="stylesheet" media="screen" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css"/>
    <![endif]-->

    <?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>

    <!--[if lt IE 9]>
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/html5.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/PIE.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/IE9.js"></script>
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/ie.js"></script>
    <![endif]-->

    <title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>
<body>
<div id="wrapper">
    <header>
        <div class="container_8 clearfix">
            <h1 class="grid_1"><?php echo CHtml::link('NoteBuddy', array('site/index')); ?></h1>
            <nav class="grid_7">
                <?php
                    $this->menu[] =
                       array('label' => Yii::app()->user->name . '<span class="arrow-down"></span>', 'url' => '#', 'itemOptions' => array('class' => 'fr'),
                            'items' => array(
                                array('label' => 'Account Settings', 'url' => array('user/update', 'id' => Yii::app()->user->id),),
                                array('label' => 'Logout', 'url' => array('site/logout'),),
                            )
                        );

                    $this->widget('zii.widgets.CMenu', array(
                        'items' => $this->menu,
                        'encodeLabel' => false,
                        'htmlOptions' => array('class' => 'clearfix'),
                     ));
                ?>
            </nav>
        </div>
    </header>
    <section>
        <div class="container_8 clearfix">
            <!-- Sidebar -->
            <aside class="grid_1">
                <nav class="global">
                <?php
                    $this->widget('zii.widgets.CMenu', array(
                        'items' => array(
                            array('label' => 'Overview', 'url' => array('site/index'), 'linkOptions' => array('class' => 'nav-icon icon-house')),
                            //array('label' => 'Recent Activity', 'url' => array('user/log'), 'linkOptions' => array('class' => 'nav-icon icon-time')),
                            array('label' => 'Notes', 'url' => array('note/index'), 'linkOptions' => array('class' => 'nav-icon icon-note')),
                            array('label' => 'To-do', 'url' => array('todo/index'), 'linkOptions' => array('class' => 'nav-icon icon-tick')),
                            array('label' => 'Contacts', 'url' => array('contact/index'), 'linkOptions' => array('class' => 'nav-icon icon-contact')),
                            array('label' => 'Bookmarks', 'url' => array('bookmark/index'), 'linkOptions' => array('class' => 'nav-icon icon-bookmark')),
                        ),
                        'htmlOptions' => array('class' => 'clearfix'),
                    ));
                ?>
                </nav>
            </aside>
            <!-- Sidebar End -->
            <!-- Main Section -->
            <section class="main-section grid_7">
                <?php echo $content; ?>
            </section>
            <!-- Main Section End -->
        </div>
        <div id="push"></div>
    </section>
</div>
<footer>
    <div id="footer-inner" class="container_8 clearfix">
        <div class="grid_8">
            <span class="fr">NoteBuddy &copy; 2010. All rights reserved.</span>
        </div>
    </div>
</footer>
</body>
</html>

<?php Yii::app()->clientScript->registerScript('core', '
    // floating menu and preview pane
    if ($("#wrapper > header").length>0) { menuYloc = parseInt($("#wrapper > header").css("top").substring(0,$("#wrapper > header").css("top").indexOf("px")), 10); }
    if ($(".preview-pane .preview").length>0) { previewYloc = parseInt($(".preview-pane .preview").css("top").substring(0,$(".preview").css("top").indexOf("px")), 10); }
    $(window).scroll(function () {
        var offset = 0;
        if ($("#wrapper > header").length>0) {
            offset = menuYloc+$(document).scrollTop();
            if (!$.browser.msie) { $("#wrapper > header").animate({opacity: ($(document).scrollTop()<=10? 1 : 0.8)}); }
        }
        if ($(".preview-pane .preview").length>0) {
            offset = previewYloc+$(document).scrollTop()+400>=$(".main-section").height()? offset=$(".main-section").height()-400 : previewYloc+$(document).scrollTop();
            $(".preview-pane .preview").animate({top:offset},{duration:500,queue:false});
        }
    });

    if (!$.browser.msie) {
        $("#wrapper > header").hover(
            function(){$(this).animate({opacity: 1});},
            function(){$(this).animate({opacity: ($(document).scrollTop()<=10? 1 : 0.8)});}
        );
    }', CClientScript::POS_READY);
?>